#include "hplcpumptabpage.h"
#include <QVBoxLayout>

HplcPumpTabPage::HplcPumpTabPage(QWidget *parent) : QWidget(parent)
{
    setWindowTitle(tr("Hplc Pump Tab Page"));
    setAttribute(Qt::WA_DeleteOnClose);

    basicControlPage = new HplcPumpBasicControlPage();
    systemExternPage = new HplcPumpSystemExternPage();
    flowCalibrationPage = new PumpFlowCalibrationPage();
    pressureCalibrationPage = new HplcPumpPressureCalibrationPage();
    motorCurrentCalibrationPage = new HplcPumpMotorCurrentCalibrationPage();
    pulseCompenCalibrationPage = new HplcPumpPulseCompenCalibrationPage();

    tabWidget = new QTabWidget();
    tabWidget->addTab(basicControlPage, tr("BasicControl"));
    tabWidget->addTab(systemExternPage, tr("SystemExtern"));
    tabWidget->addTab(flowCalibrationPage, tr("FlowCalibration"));
    tabWidget->addTab(pressureCalibrationPage, tr("PressureCalibration"));
    tabWidget->addTab(motorCurrentCalibrationPage, tr("MotorCurrentCalibration"));
    tabWidget->addTab(pulseCompenCalibrationPage, tr("PulseCompenCalibration"));

    QVBoxLayout *vbl = new QVBoxLayout();
    vbl->addWidget(tabWidget);
    setLayout(vbl);
}

void HplcPumpTabPage::closeEvent(QCloseEvent *event)
{
    Q_UNUSED(event);

    basicControlPage->close();
    systemExternPage->close();
    flowCalibrationPage->close();
    pressureCalibrationPage->close();
    motorCurrentCalibrationPage->close();
    pulseCompenCalibrationPage->close();
    tabWidget->close();
}
